<template>
  <van-cell center label-width="85%" is-link class="card-Rectify">
    <template #icon>
      <van-image round width="50px" height="50px" fit="contain" src='none'>
        <template #error><span>{{ item.zylb.substr(0, 4)}}</span></template>
      </van-image>
    </template>
    <!-- 使用 title 插槽来自定义标题 -->
    <template #default>
      <van-row class="card-label">
        <van-row class="van-ellipsis">
          {{item.bmmc}}
        </van-row>
        <van-row>
          问题严重程度：{{item.wtyzcd}}
        </van-row>
        <van-row>
          问题发现时间：{{item.wtfxsj.split(' ')[0]}}
        </van-row>
        <van-row gutter="2">
          <van-col span="12">
            制定措施超期：<span :style="{color: item.planoutdate ? 'red' : 'limegreen'}">{{item.planoutdate ? '是' : '否'}}</span>
          </van-col>
          <van-col span="12">
            实施措施超期：<span :style="{color: item.rectifyoutdate ? 'red' : 'limegreen'}">{{item.rectifyoutdate ? '是' : '否'}}</span>
          </van-col>
        </van-row>
        <van-row gutter="2">
          <van-col span="12">
            是否主动暴露：{{item.sfzdbl}}
          </van-col>
          <van-col span="12">
            是否三老问题：{{item.sfslwt}}
          </van-col>
        </van-row>
        <van-row>
          <span class="deplayColmn">
            问题描述：{{item.wtms}}
          </span>
        </van-row>
        <van-row>
          <van-tag :type="tagType" style="width:100px">{{dictRctifyStatus(item.rectify_status)}}</van-tag>
        </van-row>
      </van-row>
    </template>
  </van-cell>
</template>

<script>
import DictMixin from '@/mixins/DictMixin'
export default {
  name: 'CardRectify',
  mixins: [DictMixin],
  props: ['item'],
  computed: {
    tagType: function () {
      let type = 'default'
      switch (this.item.rectify_status) {
        case this.$vo.RectStatus.ACCE:
          type = 'default'
          break
        default:
          type = 'primary'
      }
      return type
    }
  }
}
</script>

<style scoped lang="less">
  .card-Rectify{
    margin-top: 5px;
    .van-tag{
      width: 80px;
      justify-content: center;
    }
    .van-image{
      padding: 10px;
      text-align: center;
    /deep/ .van-image__error{
      background-color: #6f9dd8;
    }
      span{
        padding: 10px 10px;
        font-size: 16px;
        letter-spacing: 2px;
        line-height: 20px;
        color: white;
      }
    }
    .card-label {
      line-height: 18px;
      padding: 0px 0px 0px 5px;
      font-size: 12px;
      .van-row:first-child{
        font-weight: 600;
      }
      .van-row:not first-child{
        font-size: 12px;
      }
    }
  }
  .van-cell{
    padding: 10px 16px 10px 5px;
  }
  /deep/.deplayColmn {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

</style>
